package com.qymerge.manage.core.constant;

/**
 * Desc
 * User cong.li
 * Date 2017/4/4
 * Time 20:56
 */
public interface ParamKey {

    /**
     * mongodb 操作符
     */
    interface Matcher {
        String $unset = "$unset";           //删除字段
        String $set = "$set";               //把文档中某个字段field的值设为value
        String $in = "$in";                 //在范围内的
        String $ne = "$ne";                 //匹配键值不等于指定值的文档。
        String $inc = "$inc";               //数组范围内的
        String $or = "$or";                 //或者
        String $gt = "$gt";                 //大于
        String $gte = "$gte";               //大于等于
        String $lt = "$lt";                 //小于
        String $lte = "$lte";               //小于等于
        String $addToSet = "$addToSet";     //加一个值到数组内，而且只有当这个值在数组中不存在时才增加。
        String $pull = "$pull";             //从数组field内删除一个等于_value的值
        String $near = "$near";             //附近
    }

    /**
     * 数据库
     */
    interface NameSpace {

        /**
         * 系统库
         */
        interface system {
            String dwd_MCRS_MDM_counter = "dwd_MCRS_MDM_counter";                 //主键表
            String dwd_MCRS_MDM_sys_user = "dwd_MCRS_MDM_sys_user";               //用户表
            String dwd_MCRS_MDM_sys_role = "dwd_MCRS_MDM_sys_role";               //角色表
            String dwd_MCRS_MDM_sys_menu = "dwd_MCRS_MDM_sys_menu";               //菜单表
            String dwd_MCRS_MDM_sys_menu_role = "dwd_MCRS_MDM_sys_menu_role";     //菜单角色表
            String dwd_MCRS_MDM_sys_user_role = "dwd_MCRS_MDM_sys_user_role";     //用户角色表
            String dwd_MCRS_MDM_picture = "dwd_MCRS_MDM_picture";                 //图片
        }

        /**
         * 获取表中所有字段
         * 时间类型数据库转换为String 显示
         */
        interface TableSelect {

            //
            String databack = "SELECT id,FileData as filedata,DATE_FORMAT(CreateDate,'%Y-%m-%d %H:%I:%s') AS createdate FROM databack WHERE 1=1 ";

            // 基础信息
            String userwx = "SELECT id, openid, nickname, nicknamebase, avatarUrl, token, username, mobile, addr, email, source, DATE_FORMAT(creaetdate,'%Y-%m-%d %H:%I:%s') AS creaetdate, DATE_FORMAT(lastlogin,'%Y-%m-%d %H:%I:%s') AS lastlogin, ip FROM userwx where 1=1 ";
            String card = "SELECT id,cardname, num, lnum FROM card WHERE 1=1 ";
            String airecord = "SELECT id,title,searchkey,info FROM airecord WHERE 1=1 ";
            String product = "SELECT productid,productname,productenname,pic,sortnum FROM product WHERE 1=1 ";
            String tempmsg = "SELECT tempmsgid,username,mobile,hxcode,isuse,DATE_FORMAT(hxdate,'%Y-%m-%d %H:%I:%s') AS hxdate,DATE_FORMAT(createdate,'%Y-%m-%d %H:%I:%s') AS createdate FROM tempmsg WHERE 1=1 ";

            // 组织机构
            String dwd_MCRS_MDM_organizational_structure = "SELECT id,Company, Depart, NoeLevel, Center, parent_id, create_user_id,create_user_name, create_time, sort, status FROM dwd_MCRS_MDM_organizational_structure WHERE 1=1 ";

            // 数据
            String xfrecord = "SELECT id,userwxid,productid,money,num,DATE_FORMAT(createdate,'%Y-%m-%d %H:%I:%s') AS createdate FROM xfrecord WHERE 1=1 ";
            String yyuemgr = "SELECT id,ydate,ytime,num,havenum FROM yyuemgr WHERE 1=1 ";
            String yyue = "SELECT id,userwxid,hecode,username,tel,ydate,ytime,hxcode,ishx,DATE_FORMAT(hxdate,'%Y-%m-%d %H:%I:%s') AS hxdate,isdelete,courseType,DATE_FORMAT(createdate,'%Y-%m-%d %H:%I:%s') AS createdate  FROM yyue WHERE 1=1 ";
            String pdz = "SELECT id,pname,cj,info,ydate,ytime,userwxid,ishx,hxcode,DATE_FORMAT(hxdate,'%Y-%m-%d %H:%I:%s') AS hxdate,isdelete,DATE_FORMAT(createdate,'%Y-%m-%d %H:%I:%s') AS createdate FROM pdz WHERE 1=1 ";
            String productprize = "SELECT productid,productname,productenname,pic,havenum,sendnum,DATE_FORMAT(adddate,'%Y-%m-%d %H:%I:%s') AS adddate,sortnum FROM productprize WHERE 1=1 ";
            String pdzmgr = "SELECT id,ydate,ytime,num,havenum FROM pdzmgr WHERE 1=1 ";

        }

    }

    /**
     * 输入
     */
    interface In {
        String parameters = "parameters";
        String empty = "";
        String dlt_parameters = "{common:{page:1,size:20},data:{}}";
    }

    interface JSortKey {
        String order_asc = "{order:1}";
        String create_time_desc = "{create_time:-1}";
        String create_time_asc = "{create_time:1}";
        String love_count_desc = "{love_count:-1}";
    }

    /**
     * 输出
     */
    interface Out {
        String code = "code";
        String msg = "msg";
        String data = "data";
        String page = "page";
        String allPage = "all_page";
        String allCount = "all_count";
        String quot = "\"";
        String version = "version";
        String picUrl = "pic_url";
    }

    /**
     * 排序
     */
    interface SortKey {
        String create_time_desc = "create_time:-1";
        String create_time_asc = "create_time:1";
        String id_desc = "_id:-1";
        String id_asc = "_id:1";
        String rank_desc = "_id:-1";
        String rank_asc = "_id:1";
    }

    /**
     * 参数
     */
    interface Parameter {
        String no_order = "";
    }

    /**
     * api地址
     */
    interface ApiUrl {
        String prod_url = "http://api.zsmy.cn";
        String dev_url = "http://localhost:2511";

        String mns_prod_url = "http://mns.api.zsmy.cn";
        String mns_dev_url = "http://test.mns.api.zsmy.cn";
    }

}
